﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FluentValidation.Results;
using MongoDB.Bson;
using NursingHome.Model.Validators;

namespace NursingHome.Model
{
    public class Patient
    {
        public ObjectId Id { get; set; }
        public string Name { get; set; }
        public string DOB { get; set; }
        public int Age { get; set; }
        public GenderType Gender { get; set; }
        public string HomePhone { get; set; }
        public string WorkPhone { get; set; }
        public string EmailAddress { get; set; }
        public Address HomeAddress { get; set; }

        public ValidationResult Validate()
        {
            return new PatientValidator().Validate(this);
        }

        public bool IsValid
        {
            get
            {
                return Validate().IsValid;
            }
        }
    }
}
